import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/loading',
    },
    {
      path: '/loading',
      name: 'loading',
      component: () => import('../views/Loading.vue'),
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/Login.vue'),
      redirect: '/login/login',
      children: [
        {
          path: 'login',
          name: 'login-login',
          component: () => import('../views/login/LoginForm.vue'),
        },
        {
          path: 'regist',
          name: 'login-regist',
          component: () => import('../views/login/RegistForm.vue'),
        },
      ],
    },
    {
      path: '/main',
      name: 'main',
      component: () => import('../views/Main.vue'),
    },
    {
      path: '/choose-charactor2v2',
      name: 'choose-charactor2v2',
      component: () => import('../views/choose-charactor2v2.vue'),
    },
    {
      path: '/game-main2v2',
      name: 'game-main2v2',
      component: () => import('../views/game-main2v2.vue'),
      redirect: '/game-main2v2/choose',
      children: [
        {
          path: 'choose',
          name: 'game-choose',
          component: () => import('@/component/game2v2/choose.vue'),
        },
        {
          path: 'game',
          name: 'game-game',
          component: () => import('@/component/game2v2/game.vue'),
        },
      ],
    },
    {
      path: '/loading-game',
      name: 'loading-game',
      component: () => import('../views/Loading_game.vue'),
    },
    {
      path: '/season',
      name: 'season',
      component: () => import('../views/season.vue'),
    },
    {
      path: '/pre-create-room',
      name: 'pre-create-room',
      component: () => import('../views/PreCreateRoom.vue'),
      redirect: '/pre-create-room/choose-mode',
      children: [
        {
          path: 'choose-mode',
          component: () => import('@/component/createroom/choose-mode.vue'),
        },
        {
          path: 'choose-friend-2v2',
          component: () => import('@/component/createroom/choose-friend-2v2.vue'),
        },
      ],
    },
  ],
})
///pre-create-room/choose-friend-2v2
///pre-create-room/choose-friend-2v2')
export default router
